﻿using DDDSample.Domain.Interfaces;
using DDDSample.Domain.Model;
using DDDSample.Infrastruct.Data.Context;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DDDSample.Infrastruct.Data.Repository
{
    /// <summary>
    /// Student仓储，操作对象还是领域对象
    /// </summary>
    public class StudentRepository:Repository<Student>, IStudentRepository
    {

        public StudentRepository(StudyContext studyContext):base(studyContext)
        {

        }

        //对特例接口进行实现
        public Student GetByEmail(string email)
        {
            return DbSet.Where(e => e.Email == email).FirstOrDefault();
        }
    }
}
